package com.sss.hloster03;

import java.util.Scanner;

public class JavaExercise07 {

	public static void main(String[] args) {
		test07();
	}

	private static void test07() {
		int letters = 0;
		int spaces = 0;
		int digits = 0;
		int other = 0;
		Scanner input = new Scanner(System.in);
		System.out.println("输入字符串：");
		String c = input.nextLine();
		char x[] = c.toCharArray();
		for (int i = 0; i < x.length; i++) {
			if (Character.isDigit(x[i])) {
				digits++;
			} else if (Character.isLetter(x[i])) {
				letters++;
			} else if (Character.isSpaceChar(x[i])) {
				spaces++;
			} else {
				other++;
			}
			
		}
		System.out.println(x.length);
		System.out.println("数字的个数是：" + digits);
		System.out.println("字符的个数是：" + letters);
		System.out.println("空值的个数是：" + spaces);
		System.out.println("其他的个数是：" + other);
	}
}
